package edu.kit.aifb.evtcrawl.pachube.structure;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;


@JsonIgnoreProperties(ignoreUnknown = true)
public class PachubeDatastream {
	private String current_value;
	private String max_value;
	private String at;
	private String min_value;
	private String id;
	private String[] tags;
	private Unit unit;
	
	public Unit getUnit() {
		return unit;
	}


	public void setUnit(Unit unit) {
		this.unit = unit;
	}


	public String toString(){
		String result = "datastream:\n";
		result += " current_value: " + current_value + "\n";
		result += " max_value: " + max_value + "\n";
		result += " at: " + at + "\n";
		result += " min_value: " + min_value + "\n";
		result += " id: " + id + "\n";
		if(tags != null){
			result += " tags: ";
			for(int i = 0; i < tags.length; i++){
				result += tags[i];
				if(!(i == tags.length - 1)) result += ", ";
			}
			result += "\n";
		}
		if(unit != null){
			result += " unit: { "+ unit.getLabel() + ", " + unit.getSymbol() +" }";
			result += "\n";
		}
		return result;
	}
	
	
	public String getCurrent_value() {
		return current_value;
	}
	public String getMax_value() {
		return max_value;
	}
	public String getAt() {
		return at;
	}
	public String getMin_value() {
		return min_value;
	}
	public String getId() {
		return id;
	}
	public String[] getTags() {
		return tags;
	}
	public void setCurrent_value(String current_value) {
		this.current_value = current_value;
	}
	public void setMax_value(String max_value) {
		this.max_value = max_value;
	}
	public void setAt(String at) {
		this.at = at;
	}
	public void setMin_value(String min_value) {
		this.min_value = min_value;
	}
	public void setId(String id) {
		this.id = id;
	}
	public void setTags(String[] tags) {
		this.tags = tags;
	}
	
	public class Unit{
		private String symbol;
		private String label;
		private String type;
		
		public String getType() {
			return type;
		}
		public String getSymbol() {
			return symbol;
		}
		public String getLabel() {
			return label;
		}
		public void setSymbol(String symbol) {
			this.symbol = symbol;
		}
		public void setLabel(String label) {
			this.label = label;
		}
		public void setType(String type) {
			this.type = type;
		}
	}
	
}
